package org.jeecg.modules.business.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.dto.BusMarketAgreementCheckInRecordDto;
import org.jeecg.modules.business.mapper.BusMarketAgreementCheckInRecordMapper;
import org.jeecg.modules.business.service.IBusMarketAgreementCheckInRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class BusMarketAgreementCheckInRecordServiceImpl extends ServiceImpl<BusMarketAgreementCheckInRecordMapper
        , BusMarketAgreementCheckInRecordDto> implements IBusMarketAgreementCheckInRecordService {
    @Resource
    private BusMarketAgreementCheckInRecordMapper busMarketAgreementCheckInRecordMapper;

    @Override
    public Page<BusMarketAgreementCheckInRecordDto> getCheckInRecord(Page<BusMarketAgreementCheckInRecordDto> page, String agreementid, String startdate, String enddate, String roomnumber, String customername) {
        if (page.getSize() == -1) {
            return page.setRecords(busMarketAgreementCheckInRecordMapper.getCheckInRecord(null,agreementid, startdate, enddate,roomnumber,customername));
        } else {
            return page.setRecords(busMarketAgreementCheckInRecordMapper.getCheckInRecord(page,agreementid, startdate, enddate,roomnumber,customername));
        }
    }
}
